// components/recommed/recommed.js
// const myBehaviors = require('../../behaviors/my-behaviors')

Component({
    // behaviors: [myBehaviors],
    /**
     * 组件的属性列表
     */
    properties: {

    },

    /**
     * 组件的初始数据
     */
    data: {
        banners: []
    },

    /**
     * 组件的方法列表
     */
    methods: {
        getBanners() {
            wx.request({
                url: 'http://localhost:3000/banners',
                success: (res) => {
                    this.setData({
                        banners: res.data
                    })
                }
            })
        },
    },
    lifetimes: {
        attached() {
            this.getBanners()
        }
    }
})